import request from '../utils/request'

// 发送验证码
export const getCode = (data) => {
  return request({
    url: '/get/code',
    method: 'post',
    data,
  })
}

// 校验验证码(注册用户)
export const userAuthentication = (data) => {
  return request({
    url: '/user/authentication',
    method: 'post',
    data,
  })
}
// 用户登录
export const userLogin = (data) => {
  return request({
    url: '/login',
    method: 'post',
    data,
  })
}

// 账号管理列表
export const authAdmin = (params) => {
  return request({
    url: '/auth/admin',
    method: 'get',
    params,
  })
}

// 菜单权限数据
export const userGetMenu = () => {
  return request({
    url: '/user/getmenu',
    method: 'get',
  })
}

// 菜单权限修改
export const userSetMenu = (data) => {
  return request({
    url: '/user/setmenu',
    method: 'post',
    data,
  })
}

// 菜单权限列表
export const menuList = (params) => {
  return request({
    url: '/menu/list',
    method: 'get',
    params,
  })
}


// 权限下拉列表
export const menuSelectList = () => {
  return request({
    url: 'menu/selectlist',
    method: 'get',
  })
}

// 修改用户信息
export const userUpdate = (data) => {
  return request({
    url: '/update/user',
    method: 'post',
    data
  })
}

// 用户菜单权限
export const menuPermissions = () => {
  return request({
    url: 'menu/permissions',
    method: 'get'
  })
}


// 获取头像列表
export const avatarList = () => {
  return request({
    url: '/photo/list',
    method: 'get',
  })
}

// 创建陪护师
export const companion = (data) => {
  return request({
    url: '/companion',
    method: 'post',
    data,
  })
}

// 获取陪护师
export const companionList = (params) => {
  return request({
    url: '/companion/list',
    method: 'get',
    params,
  })
}

// 删除陪护师
export const companionDelete = (data) => {
  return request({
    url: '/delete/companion',
    method: 'post',
    data,
  })
}

// 获取订单列表
export const orderList = (params) => {
  return request({
    url: '/admin/order',
    method: 'get',
    params,
  })
}

// 修改订单状态
export const orderUpdate = (data) => {
  return request({
    url: '/update/order',
    method: 'post',
    data,
  })
}

// 获取首页信息
export const indexInfo = () => {
  return request({
    url: '/report',
    method: 'get',
  })
}




